package com.csw.xuxianParent.xuxianRabbitmqDemo.consumer;

import com.google.gson.Gson;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component // 直接模式
@RabbitListener(queues = "csw")
public class Consumer {
	@RabbitHandler
	public void showMsg(String msg) {
		User user3 = new Gson().fromJson(msg, User.class);
		System.out.println("从csw获取到了goods.*消息" + user3.toString());
	}
}
